package WeekTest01;


public class Getdays {

	public static void main(String[] args) {
		System.out.println(getDays(2000,0));
	}
	public static int getDays(int year, int month) {
		int day = 0;
		boolean c=false;
		if ((year%400==0)||(year%4==0&&year%100!=0))
			c=true;
		
		switch (month) {
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:
			 day = 31;
			break;
		case 4:	
		case 6:	
		case 9:	
		case 11:	
              day = 30;
              break;
		case 2:
			{
			 if (c==true)
				 day = 29;
			else 
				day = 28;
			}
			break;
		default:
			System.out.println("错误的月份！");;
			break;
		}
		return day;
	}
}
